import { z } from 'zod'

import { baseManyObjectsScheme, baseSchemeWithNote } from '@/types/base.types'

import { dayjsStrValidator } from '@/utils/customValidators'

export const warrantyScheme = baseSchemeWithNote.extend({
	name: z.string(),
	end_date: dayjsStrValidator,
	contract: z.number(),
	attachs: z.number()
})

export type IWarranty = z.infer<typeof warrantyScheme>

export const warrantiesScheme = baseManyObjectsScheme.extend({
	results: z.array(warrantyScheme)
})

export type IWarranties = z.infer<typeof warrantiesScheme>
